local skel = fk.CreateSkill {
  name = "emo__shawudu",
  max_phase_use_time = 1,
}

Fk:loadTranslationTable{
  ["emo__shawudu"] = "杀无度",
  [":emo__shawudu"] = "出牌阶段限一次，你可以令一名其他角色选择摸0-3张牌，然后你视为对其使用【杀】且你可以弃置两张牌令此不可被响应。若造成伤害则获得其因此摸的牌。",

  ["#emo__shawudu"] = "杀无度：令一名其他角色选择摸0-3张牌，视为对其用【杀】",
  ["#emo__shawudu-discard"] = "杀无度：你可以弃置2张牌令【杀】不可响应",
  ["#emo__shawudu-choice"] = "杀无度：你可以摸0-3张牌，选择你的摸牌数",

  ["$emo__shawudu1"] = "杀人要理由吗？我八岁那年就已经开始杀人",
  ["$emo__shawudu2"] = "嘿嘿嘿~我不吃牛肉",
}

skel:addEffect("active", {
  card_num = 0,
  target_num = 1,
  anim_type = "offensive",
  prompt = "#emo__shawudu",
  --interaction = function() return UI.Spin { from = 0, to = 3 } end,
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to_select, selected)
    return #selected == 0 and to_select ~= player
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    local num = tonumber(
      room:askToChoice(to, {
        choices = {"0", "1", "2", "3"}, skill_name = skel.name, prompt = "#emo__shawudu-choice",
      })
    ) or 0
    local cards = to:drawCards(num, skel.name)
    local slash = Fk:cloneCard("slash")
    slash.skillName = skel.name
    if player.dead or player:prohibitUse(slash) or player:isProhibited(to, slash) then return end
    local use = { ---@type UseCardDataSpec
      from = player, tos = {to}, card = slash, extraUse = true,
    }
    if #player:getCardIds("he") > 1 then
      if #room:askToDiscard(player, {
        skill_name = skel.name, include_equip = true, cancelable = true, max_num = 2, min_num = 2,
        prompt = "#emo__shawudu-discard",
      }) > 1 then
        use.disresponsiveList = table.simpleClone(room.players)
      end
    end
    room:useCard(use)
    if use.damageDealt and use.damageDealt[to] and not player.dead then
      cards = table.filter(cards, function(id) return table.contains(to:getCardIds("he"), id) end)
      if #cards > 0 then
        room:obtainCard(player, cards, false, fk.ReasonPrey, player, skel.name)
      end
    end
  end,
})

return skel
